package coolq

import (
	log "github.com/sirupsen/logrus"

	"github.com/Mrs4s/MiraiGo/message"
	"github.com/Mrs4s/go-cqhttp/model"
	"github.com/robfig/cron/v3"
)

func (bot *CQBot) cronGroupMessageBoss() {
	GroupCode := int64(318195769)
	var ele []message.IMessageElement
	model.ReSetUserCoinsByUserID(842384566, 10000, "boss")
	ele = append(ele, message.NewText("BOSS已刷新！boss: @Yexk"))
	bot.SendGroupMessage(GroupCode, &message.SendingMessage{
		Elements: ele,
	})
}

func (bot *CQBot) CronBoss() {
	log.Info("cron boss start...")
	c := cron.New()
	d, err := c.AddFunc("0 */12 * * *", bot.cronGroupMessageBoss)
	if err == nil {
		log.Info("cron start success! cron id :", d)
	}
	c.Start()
}
